﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Citi.ResourceConsolidation.WindowUI.BoExtraction
{
    public partial class EOBusinessObjectsExtraction : Form
    {
        string reportName;
        string startUrl;
        string userLogin;
        string pathToSave;
        string parameters;
        bool newWindowNoAction;
        string boUrl;

        public EOBusinessObjectsExtraction(string reportName, string startUrl, string userLogin, string pathToSave, string parameters, bool newWindowNoAction, string boUrl)
        {
            InitializeComponent();

            this.reportName = reportName;
            this.startUrl = startUrl;
            this.pathToSave = pathToSave;
            this.userLogin = userLogin;
            this.parameters = parameters;
            this.newWindowNoAction = newWindowNoAction;
            this.boUrl = boUrl;

            this.FormClosed += EOBusinessObjectsExtraction_FormClosed;
            //var writer = new ConsoleInFile(LogPath);
            //Console.SetOut(writer);
        }

        void EOBusinessObjectsExtraction_FormClosed(object sender, FormClosedEventArgs e)
        {
            Environment.Exit(Environment.ExitCode);
        }

        private void EOBusinessObjectsExtraction_Load(object sender, EventArgs e)
        {
            new GDWExtract(webControl, reportName, startUrl, null, userLogin, pathToSave,parameters, newWindowNoAction, this)
                .StartExtraction(boUrl);
        }
    }
}
